// pages/API/get-network-type/get-network-type.js
Page({
  data: {
  },

  showNavigationBarLoading() {
    console.log('mp.showNavigationBarLoading');
    mp.showNavigationBarLoading({
      success: (res) => {
        console.log('mp.showNavigationBarLoading success', res);
      },
      fail: (res) => {
        console.log('mp.showNavigationBarLoading fail', res);
      },
      complete: (res) => {
        console.log('mp.showNavigationBarLoading complete', res);
      },
    })
  },
  hideNavigationBarLoading() {
    console.log('mp.hideNavigationBarLoading');
    mp.hideNavigationBarLoading({
      success: (res) => {
        console.log('mp.hideNavigationBarLoading success', res);
      },
      fail: (res) => {
        console.log('mp.hideNavigationBarLoading fail', res);
      },
      complete: (res) => {
        console.log('mp.hideNavigationBarLoading complete', res);
      },
    })
  },
  setNavigationBarTitle() {
    console.log('mp.setNavigationBarTitle');
    mp.setNavigationBarTitle({
      title: Math.random().toString(),
      success: (res) => {
        console.log('mp.setNavigationBarTitle success', res);
      },
      fail: (res) => {
        console.log('mp.setNavigationBarTitle fail', res);
      },
      complete: (res) => {
        console.log('mp.setNavigationBarTitle complete', res);
      },
    })
  },
  setNavigationBarColor() {
    console.log('mp.setNavigationBarColor');
    mp.setNavigationBarColor({
      frontColor: '#ffffff',
      backgroundColor: '#e8c51a',
      animation: {
        duration: 1000,
        timingFunc: 'easeIn'
      },
      success: (res) => {
        console.log('mp.setNavigationBarTitle success', res);
      },
      fail: (res) => {
        console.log('mp.setNavigationBarTitle fail', res);
      },
      complete: (res) => {
        console.log('mp.setNavigationBarTitle complete', res);
      },
    })
  },

  hideHomeButton() {
    mp.reLaunch({
      url: '/packageAPI/pages/homeButtonTest/homeButtonTest?showHome=0',
      success (res) {
        console.log('hideHomeButton redirectTo sucess', res);
      },
      fail (res) {
        console.log('hideHomeButton redirectTo fail', res);
      },
      complete (res) {}
    })
  },

  showHomeButton() {
    mp.reLaunch({
      url: '/packageAPI/pages/homeButtonTest/homeButtonTest?showHome=1',
      success (res) {
        console.log('hideHomeButton redirectTo sucess', res);
      },
      fail (res) {
        console.log('hideHomeButton redirectTo fail', res);
      },
      complete (res) {}
    })
  }
})
